package freemarker;

import freemarker.template.Configuration;
import freemarker.template.TemplateException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.io.IOException;

/**
 * freemarker 基础内容配置完毕后 会调用 postProcessConfiguration 方法
 */
@Slf4j
public class FreemarkerCustomConfigurer extends FreeMarkerConfigurer {

    @Override
    protected void postProcessConfiguration(Configuration config) throws IOException, TemplateException {
        super.postProcessConfiguration(config);
        config.setSharedVariable("xxxx", new Object());
    }

}
